<?php
class products extends CWidget
{
	public $_catID = null;        
        public $_content = 0;
	public $_title = "";
	public function init()
	{
		$cs = Yii::app()->getClientScript();
		$cs->registerScriptFile(Yii::app()->theme->baseUrl."/js/easyTooltip.js");

		$cs->registerScript(
				'big-item',
				'$(".item-img").easyTooltip();',
				CClientScript::POS_READY
		);
		
		parent::init();
	}
	public function run()
	{            
		
		$criteria = new CDbCriteria;                
                $model = Product::model()->findbyPk($this->_catID);
                if($this->_content==1)
                {
                $data = $model->buyMoreProducts ;	                		
                }
                else
                {
                    $data = $model->sameFunctionProducts;	                		                    
                }
		$this->render('default', array(
					'data' =>$data,
		
					'catID'=>$this->_catID,					
				));
	}
}